<!-- Faraday Penetration Test IDE -->
<!-- Copyright (C) 2013  Infobyte LLC (http://www.infobytesec.com/) -->
<!-- See the file 'doc/LICENSE' for the license information -->

<section id="main" class="status-report seccion clearfix">
  <div class="faraday-header-border-fix"></div>
    <div class="right-main">
		<div ng-controller="headerCtrl" ng-include="'scripts/commons/partials/header.html'"></div>
        <div id="reports-main" class="fila clearfix">
            <div class="button-control col-md-12 col-sm-12 col-xs-12">
                <div class="control-wrapper control-new">
                    <button type="button" class="btn btn-success btn-new" title="{{workspaceData.readonly == true ? 'Read-only. Workspace disabled': 'New Vulns'}}"  ng-click="new()" ng-disabled="workspaceData.readonly == true">
                        New
                    </button>
                </div>
                <div class="control-wrapper control-edit">
                    <button type="button" class="btn btn-default edit" title="{{workspaceData.readonly == true ? 'Read-only. Workspace disabled': 'Edit selected vulns'}}" ng-click="edit()" ng-disabled="getCurrentSelection().length != 1">
                        <img src="images/icon-toolbar-edit.svg" class="edit-icon" />
                    </button>
                    <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" title="SingleActions" ng-show="getCurrentSelection().length === 1"  ng-disabled="workspaceData.readonly == true">
                        <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu dropdown-menu-right" role="menu">
                        <li><a class="ws" ng-click="saveAsModel()">Create template</a></li>
                        <li><a class="ws" ng-click="showExploits()">Search exploits</a></li>
                    </ul>
                    <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" title="Actions" ng-hide="getCurrentSelection().length < 2" ng-disabled="workspaceData.readonly == true">
                        <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu dropdown-menu-right" role="menu" ng-show="getCurrentSelection().length >= 2">
                        <li><a class="ws" ng-click="editString('name')">Edit name</a></li>
                        <li><a class="ws" ng-click="editText('desc', 'description')">Edit description</a></li>
                        <li><a class="ws" ng-click="editText('data')">Edit data</a></li>
                        <li><a class="ws" ng-click="editText('resolution')">Edit resolution</a></li>
                        <li><a class="ws" ng-click="editSeverity()">Edit severity</a></li>
                        <li><a class="ws" ng-click="editEaseofresolution()">Edit ease of resolution</a></li>
                        <li><a class="ws" ng-click="editReferences()">Add references</a></li>
                        <li><a class="ws" ng-click="editImpact()">Edit impact</a></li>
                        <li><a class="ws" ng-click="editStatus()">Edit status</a></li>
                        <li><a class="ws" ng-click="editPolicyviolations()">Edit policy violations</a></li>
                        <li><a class="ws" ng-click="editConfirm()">Confirm/Change to false positive</a></li>
                        <li ng-show="vulnWebSelected" role="separator" class="divider"></li>
                        <li ng-show="vulnWebSelected"><a class="ws" ng-click="editString('method')">Edit method</a></li>
                        <li ng-show="vulnWebSelected"><a class="ws" ng-click="editString('pname', 'param name')">Edit param name</a></li>
                        <li ng-show="vulnWebSelected"><a class="ws" ng-click="editString('params', 'parameters')">Edit parameters</a></li>
                        <li ng-show="vulnWebSelected"><a class="ws" ng-click="editString('path')">Edit path</a></li>
                        <li ng-show="vulnWebSelected"><a class="ws" ng-click="editString('query')">Edit query</a></li>
                        <li ng-show="vulnWebSelected"><a class="ws" ng-click="editString('website')">Edit website</a></li>
                        <li ng-show="vulnWebSelected"><a class="ws" ng-click="editText('request')">Edit request</a></li>
                        <li ng-show="vulnWebSelected"><a class="ws" ng-click="editText('response')">Edit response</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a class="ws" ng-click="editCWE()">From vulnerability template</a></li>
                        <li><a class="ws" ng-click="saveAsModel()">Create vulnerability templates</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a class="ws" ng-click="showExploits()">Search exploits</a></li>
                    </ul>
                </div>
                <div class="control-wrapper">
                    <button type="button" class="btn btn-default" title="{{workspaceData.readonly == true? 'Read-only. Workspace disabled': 'Delete selected items'}}" ng-click="delete()" ng-disabled="workspaceData.readonly == true">
                        <img src="images/icon-toolbar-delete.svg" class="delete-icon" />
                    </button>
                </div>
                <div class="control-wrapper search-wrapper">
                    <form role="form" ng-submit="searchFor(true, searchParams)" title="The search expression can't contain parentheses that are not closed, double quotes that are not closed, or double spaces.">
                        <div class="form-group" ng-class="{'has-error':!isValidExpression(searchParams)}">
                            <div class="input-group">
                                <span class="input-group-addon glyphicon-btn glyphicon glyphicon-remove" ng-click="searchFor(false, '')" ng-if="searchParams !== '' || (search && search != 'confirmed=true')"></span>
                                <input type="text" class="form-control" placeholder="Enter keywords" ng-change="currentPage = 1" ng-model="searchParams" />
                                <span class="input-group-addon glyphicon-btn" ng-click="searchFor(true, searchParams)" ng-disabled="!isValidExpression(searchParams)">
                                    <img src="images/icon-toolbar-searchbar-loupe.svg" class="search-icon" />
                                </span>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="control-wrapper download-wrapper">
                    <button file-exporter="csv()" type="button" class="btn btn-default" title="Download CSV for current workspace">
                        <img src="images/icon-toolbar-download.svg" class="download-icon" />
                    </button>
                </div>
                <div class="control-wrapper download-wrapper" ng-hide="fileUploadEnabled === true">
                    <button ng-click="enableFileUpload()" type="button" class="btn btn-default" title="{{workspaceData.readonly == true ? 'Read-only. Workspace disabled': 'Upload a report'}}" ng-disabled="workspaceData.readonly == true">
                        <img src="images/icon-toolbar-upload.svg"/>
                    </button>
                </div>
                <div class="pl" ng-show="fileUploadEnabled === true">
                    <span class="file-container">
                        <button ng-if="fileToUpload === undefined" type="button" class="btn btn-success btn-labeled no-border-radius">
                            <span class="btn-label"><i class="fa fa-upload"></i>
                        </span>Select file</button>
                        <input type="file" file-model="fileToUpload" ng-class="{'file-selected': fileToUpload !== undefined}">
                    </span>
                    <span ng-if="fileToUpload !== undefined">
                        <button type="button" class="btn btn-success btn-labeled no-border-radius" title="Upload selected file" ng-click="uploadFile()">
                            <span class="btn-label"><i class="fa fa-upload"></i>
                        </span>Upload file</button>
                        <p class="file-name">{{fileToUpload.name}}</p>
                    </span>
                </div>
                <div class="space-wrapper"></div>
                <div class="control-wrapper control-wrap-right">
                    <div class="btn-group">
                        <button type="button" ng-if="propertyGroupBy" class="btn btn-danger" title="Clear" ng-click="clearGroupBy()">
                            <i class="fa fa-times"></i>
                        </button>
                        <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" title="{{propertyGroupBy || 'Group By'}}">
                            {{ (propertyGroupBy | uppercase) || "Group By"}}
                        </button>
                        <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" title="Group By">
                            <span class="caret"></span>
                        </button>
                        <ul class="dropdown-menu dropdown-menu-right" role="menu">
                            <li ng-repeat="(column, show) in columns">
                                <a class="ws" ng-show="show && (column !== 'evidence' && column !== 'impact' && column !== 'web' && column !== 'easeofresolution' && column !== 'date')" ng-click="groupBy(column)">{{column}}</a>
                            </li>
                        </ul>
                    </div>
                    <div class="btn-group">
                        <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" title="{{propertyFilterConfirmed}}">
                            {{ (propertyFilterConfirmed) }}
                        </button>
                        <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" title="Filter confirmed vulns">
                            <span class="caret"></span>
                        </button>
                        <ul class="dropdown-menu dropdown-menu-right" role="menu">
                            <li>
                                <a class="ws" ng-if="propertyFilterConfirmed !== 'All'" ng-click="filterConfirmed('All')">All</a>
                                <a class="ws" ng-if="propertyFilterConfirmed !== 'Confirmed'"  ng-click="filterConfirmed('Confirmed')">Confirmed</a>
                                <a class="ws" ng-if="propertyFilterConfirmed !== 'Unconfirmed'" ng-click="filterConfirmed('Unconfirmed')">Unconfirmed</a>
                            </li>
                        </ul>
                    </div>
                    <div class="btn-group">
                        <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" title="Add columns">
                            Add columns
                        </button>
                        <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" title="Add Columns">
                            <span class="caret"></span>
                        </button>
                        <ul class="dropdown-menu dropdown-menu-right" role="menu">
                            <li ng-repeat="(column, show) in columns">
                                <a class="ws" ng-click="toggleShow(column, show)" ng-show="!show">{{column}}</a>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="reports col-md-12 col-sm-12 col-xs-12">
                <i ng-if="loading" class="fa fa-spinner fa-spin loading-spinner"></i>
                <div ui-grid="gridOptions" ui-grid-grouping ui-grid-selection ui-grid-pagination ui-grid-pinning ui-grid-resize-columns class="grid status-report-grid" ng-style="{'height' : gridHeight }"></div>

                <div id="counter">
                    <span>Total</span>
                    <span class="counterNum">{{gridOptions.totalItems}}</span>
                    <div ng-if="search">
                        <span>Viewing</span>
                        <span class="counterNum">{{gridOptions.data.length}}</span>
                    </div>
                    <p style="margin:0px" ng-if="!search"></p>
                    <span>Selected</span>
                    <span class="counterNum">{{getCurrentSelection().length}}</span>
                </div>
            </div>
            <!-- .reports -->
        </div>
        <!-- #reports-main -->
    </div>
    <!-- .right-main -->
</section>
<!-- #main -->
